MEGA MAN REMASTERED NOTES

These are most of the notes I took whil doing this project.  There are other notes on other notepad files, but they are mostly logs of the game's original code.

NOTE: Some code locations you see in this document may be different in the actual ROM due to updating the locations in the ROM.

Screen ID is address $1B

Frame Counter is address $23

Current Stage is address $31

Current Bank is address $42

Weapons is address $5F

$FF00 is my MMC3 Bankswap Routine

$FF00 to $FFDD is all of my custom hard-wired ASM code.

$100 - $105 are my CHR addresses

$106 is my Initial CHR address & SRAM Toggle Address.  The Initial CHR is loaded only once.  Once the initial CHR is loaded, this byte is set to 01.  Then, the Initial CHR Routine is never read again.  Also, the SRAM Address $A001 is set to 01, and then never set again.  This enables SRAM.

$107 is my In-Stage address.  0 if not in stage.  1 if in stage.

$108 is Wily Stage 1 Boss Flag.  This is set to 1 when $31 (Stage number) is 06, and $1B (Screen number) is 27.  When it is not, this is 0.

$109 is Wily Stage 4 Boss Flag.  Final Boss, Wily.  This is set to 1 when $31 (Stage number) is 09, and $1B (Screen number) is 23.  When it is not, this is 0.

$10A is the After-Ready Address.  After Ready, it is 1.  After the stage is over, or Megaman dies, this is set to 0.  This is needed for the final VROM page.

$10B is the Inventory Control Byte.  0 when not open.  1 when open.

$10C is the Remastered Text Drawn Byte.  If this is 0, the text wasn't drawn.  If it is 1, that means it was drawn.  If it is 1, then it means that it will never be drawn again.  This address was set up because the Title Screen and the Game Over Screen share the same Stage Number, which was causing the Game Over Screen to be messed up.

$10D is the title screen option cursor.  0 is Continue, 1 is Erase Data.

$10E is the Boss preview screen.  0 is not on the boss preview screen.  1 is on the boss preview screen.

This is the original code.  The new code branches to free space which constantly reads the CHR Load routine, constantly loads the stage CHR, and then executes the original code and returns.

$D54A:E6 23     INC $23 = #$A5
$D54C:A9 04     LDA #$04
$D54E:20 00 FF  JSR $FF00
$D551:20 00 90  JSR $9000

This is the original code.  The new code branches to free space which takes care of the initial CHR load routine, executes the original code, and returns.

$C042:20 8D D5  JSR $D58D

Before stage loads.

$C613:20 9C C3  JSR $C39C

Before returning to Stage select.

$C10C:20 95 D4  JSR $D495

Right before going to stage select from title screen.

$D890:20 F6 BF  JSR $BFF6


----------------------------------------------
BANK 0 - Custom ASM Code Added

My Sprite CHR Bank Code

$8FAC

My Top-Right Background Bank Code

$9132

My Bottom-Right Background Bank Code

$9158

This is my Megaman sprite credits bank code.

$9184

This is my final VROM page code ($105).

$9196

The is the final VROM page Credits CHR.

$9344
---------------------------------------------------


Pause Address is $41.  0 is running, 1 is paused.

$2E8 - $2FF are the Sprite RAM addresses where my "PAUSED" text code will go.

My Stage Select CHR Load Routine

$FF92:A0 05     LDY #$05
$FF94:B9 9E FF  LDA $FF9E,Y @ $FF9E = #$14
$FF97:99 00 01  STA $0100,Y @ $0100 = #$18
$FF9A:88        DEY
$FF9B:10 F7     BPL $FF94
$FF9D:60        RTS

Setup stage select

$D846:A9 06     LDA #$06
$D848:85 42     STA $42 = #$04
$D84A:20 00 FF  JSR $FF00
$D84D:A9 00     LDA #$00
$D84F:8D 06 20  STA $2006 = #$00
$D852:8D 06 20  STA $2006 = #$00

This is the code that jumps to the Stage Select from the Game Over Screen!  I had it jump to a piece of code I programmed earlier, which sets $107 to 0, jumps to the Stage Select CHR Load Routine, and then executes the original code JSR $D495! :)

$FA28:20 95 D4  JSR $D495

Free Space that wasn't logged during a full gameplay.

$FCE0 - $FCFF

0x1FCF0 - 0x1FD0F

Wily Saucer code.

$B887:20 F1 BC  JSR $BCF1

Free Space that wasn't logged during a full gameplay.  This is where the wily saucer CHR goes.

-----------------------------------------
BANK 6 FREE SPACE (Inventory is open)

$AA72

0x1AA82 - 0x1AB0F
-----------------------------------------

After-Ready Address

$9146:A0 00     LDY #$00
$9148:84 55     STY $55 = #$00

-----------------------------------------
BANK 5 FREE SPACE (Inventory is not open)

$8DAC, $8DB6

0x14DBC - 0x14E0F
-----------------------------------------

Begin Stage from Death

$C2CE:4C 81 90  JMP $9081

Jump to Game Over

$C2D1: 4C 38 90  JMP $9038

Reload Stage after dying

$C24A:20 95 D4  JSR $D495

This is where the score-display code was.  This is now free space! :)

0x3D384 - 0x3D3A8

------------------------------------------------
BANK 4 - TITLE SCREEN BANK - FREE SPACE BLOCK

$BE60

0x13e70 - 1400f
-----------------------------------------------

Title Screen Code I hijacked, so that I could write the words "Remastered"

$F9FB:A2 40     LDX #$40
$F9FD:20 78 D4  JSR $D478

Hijack code for Wily's crying pose.  This sets $107 to 0, and then puts the crying pose chr in.

$CB57:A2 11     LDX #$11
$CB59:86 2F     STX $2F = #$00

This is the free space where the $107 is set to 0, and the crying pose chr is set.

$8DC8

This is the score code.  This is hijacked to set $107 back to 1.

$C0A6:20 04 C2  JSR $C204

This is the free space where $107 is set back to 1.

$8DD7

----------------------------------------------

0x010edb

This is the color in the attribute table, for the logo "Remastered".

0x010ef4 - 0x010ef5

title screen location of "Press Start" (Continue)

$F9D7

this is where I hijack to my code which writes "Erase Data"

The bank is 04.  The offsets are 0x010fae - 0x01100f (free space for code).  The address is $8F9E.

$F9D7:BD E4 8E  LDA $8EE4,X @ $8EE4 = #$22	hijacked code

These 4 bytes are the sprite data for the titlescreen arrow.  The arrow is right next to Continue.

87 EE 02 20

This is the block of code that was causing the problem.  This is original game code, which "hides" sprites.

$D478:A9 F8     LDA #$F8
$D47A:99 00 02  STA $0200,Y @ $0200 = #$00
$D47D:C8        INY
$D47E:C8        INY
$D47F:C8        INY
$D480:C8        INY
$D481:CA        DEX
$D482:D0 F6     BNE $D47A
$D484:60        RTS

This is the code that jumps to the block above, on the title screen.  This is what is preventing my sprites from showing up.

$BE90:A2 40     LDX #$40
$BE92:20 78 D4  JSR $D478


code I hijack to display my arrow

$FA00:A5 FF     LDA $FF = #$90
$FA02:09 80     ORA #$80
$FA04:85 FF     STA $FF = #$90

This goes to free space to display the arrow.

JSR $8FD1


This is the code that I need to modify to take care of the arrow.  Basically, I need to jump to a load of free space from $FA10, and have it check other buttons using other CMPs.  If no conditions are met, it branches to $FA0D like normally.


$FA0D:20 1B C0  JSR $C01B
$FA10:A5 14     LDA $14 = #$00
$FA12:C9 08     CMP #$08
$FA14:D0 F7     BNE $FA0D

--------------------------------
FREE SPACE IN BANK 4 (TITLESCREEN), that I can use for my title screen options cursor.

$BEE2

0x013ef2 - 0x01400f
--------------------------------


BANK 0

$9350 (0x1360)

This is where I will put the titlescreen Japanese Rockman pose sprite code.


0x10ed9 is the attribute table byte I have to modify to make the Megaman sprite whole

0x10ce0 is the title screen background palettes


$9565 in Bank 0 is free space

This below is free space I overwrited.

0x1fee0 - 0x1ff0f

$FED0